a11y: Use a DOM-like API for iterating accessible objects
authorLukáš Tyrychtr <lukastyrychtr@gmail.com>
Fri, 25 Nov 2022 15:55:12 +0000 (16:55 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Fri, 3 Feb 2023 10:49:17 +0000 (11:49 +0100)
commitbc48bfc2b63d5be990068872a912108706419efb
treee081ca4cf434e88a7a1aa72fc79e60a3334003c8
parent6100258ba2001212e5e27f4c396bd18bc9c40d72
a11y: Use a DOM-like API for iterating accessible objects

The `get_child_at_index()` API model comes from AT-SPI, and it's not an
efficient design, especially when coupled with large widgets.

Replace `get_child_at_index()` with `get_first_accessible_child()` and
`get_next_accessible_sibling()`.

That allows efficiently retrieving all the children, simplifies the
implementation of GtkAccessible in GtkWidget and closely resembeles the
GtkWidget API.

Getting the last child and previous sibling for iterating backwards is
not a part of the interface at the moment, but they can be added at a
later date.

Note that this change required tracking the next stack page in
GtkStackPage.
gtk/a11y/gtkatspicontext.c
gtk/gtkaccessible.c
gtk/gtkaccessible.h
gtk/gtkstack.c
gtk/gtkwidget.c